package Mangos::DB::Realmd::Account;

use strict;

use base qw(Mangos::DB::Realmd);

__PACKAGE__->meta->setup
(
    table   => 'account',

    columns => 
    [
        id              => { type => 'integer', not_null => 1 },
        username        => { type => 'varchar', default => '', length => 32, not_null => 1 },
        sha_pass_hash   => { type => 'varchar', default => '', length => 40, not_null => 1 },
        gmlevel         => { type => 'integer', default => '0', not_null => 1 },
        sessionkey      => { type => 'scalar', length => 4294967295 },
        v               => { type => 'scalar', length => 4294967295 },
        s               => { type => 'scalar', length => 4294967295 },
        email           => { type => 'text', length => 65535 },
        joindate        => { type => 'timestamp', not_null => 1 },
        last_ip         => { type => 'varchar', default => '0.0.0.0', length => 30, not_null => 1 },
        failed_logins   => { type => 'integer', default => '0', not_null => 1 },
        locked          => { type => 'integer', default => '0', not_null => 1 },
        last_login      => { type => 'timestamp', not_null => 1 },
        active_realm_id => { type => 'integer', default => '0', not_null => 1 },
        expansion       => { type => 'integer', default => 3, not_null => 1 },
        mutetime        => { type => 'bigint', default => '0', not_null => 1 },
        locale          => { type => 'integer', default => '0', not_null => 1 },
    ],

    primary_key_columns => [ 'id' ],

    unique_key => [ 'username' ],
);

1;

package Mangos::DB::Realmd::Account::Manager;

use strict;
use warnings;

use base 'Rose::DB::Object::Manager';

sub object_class { 'Mangos::DB::Realmd::Account' }

__PACKAGE__->make_manager_methods('account');

1;
